package com.study.model.pojo.HRpojo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;

/**
 * The persistent class for the dept_tab database table.
 * 
 */
@Entity
@Table(name="dept_tab")
@NamedQuery(name="DeptTab.findAll", query="SELECT d FROM DeptTab d")
public class DeptTab implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int deptid;

	private String deptname;

	//bi-directional many-to-one association to EmpTab
	@OneToMany(mappedBy="deptTab")
	private List<EmpTab> empTabs;

	public DeptTab() {
	}

	public int getDeptid() {
		return this.deptid;
	}

	public void setDeptid(int deptid) {
		this.deptid = deptid;
	}

	public String getDeptname() {
		return this.deptname;
	}

	public void setDeptname(String deptname) {
		this.deptname = deptname;
	}

	public List<EmpTab> getEmpTabs() {
		return this.empTabs;
	}

	public void setEmpTabs(List<EmpTab> empTabs) {
		this.empTabs = empTabs;
	}

	public EmpTab addEmpTab(EmpTab empTab) {
		getEmpTabs().add(empTab);
		empTab.setDeptTab(this);

		return empTab;
	}

	public EmpTab removeEmpTab(EmpTab empTab) {
		getEmpTabs().remove(empTab);
		empTab.setDeptTab(null);

		return empTab;
	}
}